Organization: America Online, Inc. (1-800-827-6364)
>>I think the problem is that you are moving the control without telling
the
>>Dialog Manager. After moving the control, use SetDialogItem to set the
>>controls' new location (with the iRect parameter).
Thanks! SetDItem() is exactly what I needed to do to get things to work
correctly. I appreaciate the help.
Cary
---------------------------
>From rsandhu@cs.ucl.ac.uk (Raghbir Sandhu)
Subject: Opening Control Panels from within an Application
Date: Wed, 14 Jun 1995 12:49:53 GMT
Organization: University College London
Hi,
I am working on small project where I need to open the ConfigPPP control panel,
set a few parameters and then perform the dial-up. What I want to know is there
a way of doing this from WITHIN the application itself? I don't want to rely on
AppleScript code to do this.
Any help is much appreciated.
Response by email please.
Thanks,
Raghbir
rsandhu@cs.ucl.ac.uk
+++++++++++++++++++++++++++
>From andrew@adcode.demon.co.uk (Andrew Crane)
Date: 18 Jun 1995 21:09:39 +0100
Organization: Adcode
In article <rsandhu.803134193@cs.ucl.ac.uk>, rsandhu@cs.ucl.ac.uk (Raghbir Sandhu) wrote:
: I am working on small project where I need to open the ConfigPPP control panel,
: set a few parameters and then perform the dial-up. What I want to know is there
: a way of doing this from WITHIN the application itself? I don't want to rely on
: AppleScript code to do this.
:
: Any help is much appreciated.
You may be better off doing it in a script anyway - at some stage you will have to poke an event into the queue to simulate the mouse-down on the Open button and then the go-away box.
You can invoke it quite easily with OpenDeskAcc, as any interactive application can be opened in this way (that's how you implement the apple menu). The opened application then takes over as the foreground task and you're behind it. If you have elected to receive background time, you can check that it has opened, poke your events at it, tell it to go away and regain control as the foreground Appl.
Andrew
--
Andrew Crane, Egham, Surrey, England
+++++++++++++++++++++++++++
>From peter@mail.peter.com.au (Peter Lewis)
Date: Tue, 20 Jun 1995 17:03:22 +0800
Organization: iiNET Technologies
[Sorry, I appear to be posting source code to alt.sources.mac. I know
this is breaking a long standtion of posting only discussion, but I
couldn't help myself]
In article <rsandhu.803134193@cs.ucl.ac.uk>, rsandhu@cs.ucl.ac.uk (Raghbir
Sandhu) wrote:
>I am working on small project where I need to open the ConfigPPP control panel,
>set a few parameters and then perform the dial-up. What I want to know is there
>a way of doing this from WITHIN the application itself? I don't want to rely on
>AppleScript code to do this.
I'm not sure if this will solve your problem, but it gives me a chance to
post my process handling code. The following uses AppleEvents (not
AppleScript) to control the scriptable finder to open a control panel. It
also has lots of other neat process handling code.
Enjoy,
Peter.
unit MyProcesses;
interface
uses
Types, Files, Memory, Processes;
const
application = 'APPL';
function FindApplication (creator: OSType; var fs: FSSpec): OSErr;
function FindProcess (creator, typ: OSType; var process:
ProcessSerialNumber; var fs: FSSpec): boolean;
function LaunchWithDocument (creator, typ: OSType; fs: FSSpec; tofront:
boolean):OSErr;
function LaunchApp (creator, typ: OSType; tofront: boolean):OSErr;
procedure QuitApplication (creator, typ: OSType);
function LaunchFSSpec (var fs: FSSpec; tofront: boolean):OSErr;
function FindControlPanel (fcreator: OSType; var fs: FSSpec): OSErr;
function TellFinderToLaunch (fs: FSSpec; tofront: boolean): boolean;
function OpenControlPanel (fcreator: OSType): boolean;
>From ivanski@world.std.com (Ivan M CaveroBelaunde)
Date: Wed, 21 Jun 1995 22:06:17 GMT
Organization: The World Public Access UNIX, Brookline, MA
rpa@netcom.com (Ramin Firoozye) writes:
>[ I posted this on c.s.m.p but found it had been rendered defunct...
> Here it is again. Sorry for the duplication. R]
>---
>[ This is a question for those who have dabbled in the bowels of the
>QuickTime 2.0 SDK... I'm also hoping someone from Apple may get this
>and get it to the right person. - R.]
>I was playing around with the new call "NewMovieFromUserProc".
>I'm wondering if maybe I'm missing something. The description in the
>manual (pp 3-6) is somewhat confusing.
You're misunderstanding the purpose of NewMovieFromUserProc.
The NewMovieWhatever calls basically read in a "public movie", a chunk
of data in the format defined by MoviesFormat.h and the QT docs.
The "public movie" is basically a *descriptor* for the actual
media data and how it plays (tracks, media, timescales, spatial size,
duration, etc.) but does not contain any of the actual *sample* data.
Mac-centric QT movies stored the public movie in the 'moov' resource
in the resource fork. Cross-platform QT movies store the public movie
at the end of the data fork (with some twists; xplatform movies are
actually composed of "atoms" [chunks of the file with an 8-byte
header identifying the chunk and its length], of which the
public movie is one). NewMovieFromUserProc allows you to feed in
the data normally stored in the public movie (either the resource
or the "public movie atom" at the end of a xplatform movie) from
any source; it could be, for example, algorithmically generated
(make for some funny movies).
>I have a simple movie which has been converted for non-mac use.
>I open the file using stdio calls. Then I use NewMovieFromUserProc
>and give it my own GetMovie procptr. As the refCon, I pass down
>the file descriptor for the opened movie file. It calls my procptr and
>asks for 8-bytes from offset 0. This all works great, no problems until
>NewMovieFromUserProc returns with a noMovieFound error.
If you have a standard xplatform QT movie you should just use
the standard NewMovieFromFile and OpenMovieFile calls with the
magical movieInDataForkResID for the res ID in the call.
<SNIKT>
>I thought NewMovieFromUserProc was there so you could use it to get movie
>data. But the description all of a sudden says the offset is into the
>movie resource "NOT THE MOVIE FILE". Huh? Anyway, I had already converted
>the movie for non-mac use so all stuff was to come out of the data fork
>anyway. Right?
Nope; NewMovieFromUserProc is not for getting the data as explained
above. If you want to get at the movie data you need to use the
GetMediaSample/GetMediaSampleReference calls. Navigation can be
quite tricky as the QT hierarchy (Movie contains any number of tracks,
potentially layered together; each track is an edit list of the media;
media is a time-ordered sequence of samples; samples are chunk of
raw data which sit in a file and are interpreted by the appropriate
media handler) can allow for extremely complex combinations that
can be really hard to walk.
Oh, and the data handlers have nothing to do with this. Data handlers
sit below the media handlers and fetch the data for it.
-Ivan
- -
Ivan Cavero Belaunde (ivanski@world.std.com)
---------------------------
>From davewise@aol.com (DaveWise)
Subject: Selecting a DA
Date: 20 Jun 1995 12:53:34 -0400
Organization: America Online, Inc. (1-800-827-6364)
Ok. I am new to programming so go slow. I made an app that has a window
this is very exciting for me. Now I want to add apple menu options as
well. I have an about window which is cool but I can't get items in the
apple menu other that my about to launch while my window is open. I am
using openDeskAcc or whatever that toolbox call is. And as soon as I close
my window the item that I chose (usually the calculator) is launched.
+++++++++++++++++++++++++++
>From andrew@adcode.demon.co.uk (Andrew Crane)
Date: 20 Jun 1995 23:10:12 +0100
Organization: Adcode
In article <3s6uee$1dg@newsbf02.news.aol.com>, davewise@aol.com (DaveWise) wrote:
: Ok. I am new to programming so go slow. I made an app that has a window
: this is very exciting for me. Now I want to add apple menu options as
: well. I have an about window which is cool but I can't get items in the
: apple menu other that my about to launch while my window is open. I am
: using openDeskAcc or whatever that toolbox call is. And as soon as I close
: my window the item that I chose (usually the calculator) is launched.
In article <3s6uee$1dg@newsbf02.news.aol.com>, davewise@aol.com (DaveWise) wrote:
: Ok. I am new to programming so go slow. I made an app that has a window
: this is very exciting for me. Now I want to add apple menu options as
: well. I have an about window which is cool but I can't get items in the
: apple menu other that my about to launch while my window is open. I am
: using openDeskAcc or whatever that toolbox call is. And as soon as I close
: my window the item that I chose (usually the calculator) is launched.
1. Need to add the desk accessories to the menu:
AddResMenu(AppleMenu,'DRVR');
where AppleMenu is a handle to your apple menu's resource.
2. In your event loop, when a menu item is chosen in the mouseDown section, respond like this: (forget about the Boolean return - I've just pulled this from an unfinished application). The MenuItem variable is derived from the